<?php
$script = <<<SCRIPT
    $("#accesos-label").next().children().wrapAll('<div style="height:150px;overflow:scroll;font-size:0.7em"/>')
SCRIPT;
?>

<style>
#user_sel{
    font-size:0.7em;
    color:#000000;
}
#user_sel li{
   margin-top:5px;
}

</style>

<script>
$(document).ready(function(){ 
    $("#dialog").dialog({ title: '<?=ucfirst($this->actionName) .' '.ucfirst($this->controllerName)?> ' });
    
    //$('input:checked[name="accesos[]"] ').size();
    
    $('#accesos-label').append('<div><ul id="user_sel"><li></li></ul></div>')
    
    userss();
    
    $('input[name="accesos[]"] ').change(function () {
        userss();
    })

})

function userss(){
        $("#user_sel").html('<li></li>');
        $('input:checked[name="accesos[]"] ').each(function(index) {
            $("#user_sel li:last").append("<li>"+$(this).parent().text()+"</li>");
        });
}


</script>

<style>
#<?=$this->id?> td.acceso{height:150px;overflow:scroll;font-size:0.7em}
</style>



<?php 
$this->form->setAction($this->url());

echo $this->form;

echo $this->partial('form_js.phtml', 
    array(	
        'actionName'=>$this->actionName,
        'id'=>$this->id,
        'id_tablesorter'=>$this->id_tablesorter,
        'onready'=>$script,
        )
);


